<?php 

/**
* 
*/
class ControllerGuanzhu extends GetLoad
{
	public function index(){
		$this->load("Model/guanzhu");

	}


	public function getguanzhuindex($name_id){

		$this->index();
		$data=array();
		$guanzhu= new ModelGuanzhu();
		$reluse=$guanzhu->getguanzhu($name_id[0]);
		$data['name']=$name_id[0];



		foreach ($reluse as $value) {
			$data['guanzhu'][] = array(
				'name' 		=>$guanzhu->getname($value['noticer_id'])['name'],
				'touxiang'	=>$guanzhu->getname($value['noticer_id'])['touxiang'],
				'xuanyan'	=>$guanzhu->getname($value['noticer_id'])['xuanyan'],
				'name_id'	=>$guanzhu->getname($value['noticer_id'])['name_id'],
				'title'     =>$guanzhu->panduan($name_id[0],$value['noticer_id']),
				'url'		=>$guanzhu->panduan2($name_id[0],$value['noticer_id'])
			);
			
		}

		return $data;


	}
	
	public function getguanzhu($name_id){
			$data=array();

		$data=$this->getguanzhuindex($name_id);
		
			//var_dump($data);
			//$this->getwoguanzhu($name_id);
		$this->view("view/guanzhu",$data);

	}


	public function getwoguanzhu($name_id){
		$this->index();
		$data=array();
		$guanzhu= new ModelGuanzhu();
		$reluse=$guanzhu->getwoguanzhu($name_id[0]);
		$data['name']=$name_id[0];


		foreach ($reluse as $value) {
			$data['guanzhu'][] = array(
				'name' 		=>$guanzhu->getname($value['concerned_id'])['name'],
				'touxiang'	=>$guanzhu->getname($value['concerned_id'])['touxiang'],
				'xuanyan'	=>$guanzhu->getname($value['concerned_id'])['xuanyan'],
				'name_id'	=>$guanzhu->getname($value['concerned_id'])['name_id'],
				'title'     =>"取消关注",
				'url'		=>"./index.php?route=Controller/guanzhu/ControllerGuanzhu/quxiaoguanzhu&=".$value['id']);
		}


		//var_dump($data);
		$this->view("view/guanzhu",$data);

	}


	public function quxiaoguanzhu($id){

		$this->index();

		$guanzhu= new ModelGuanzhu();
		$guanzhu->quxiaoguanzhu($id[0]);


	}

	public function guanzhu($concerned_id){

		$this->index();

		$guanzhu= new ModelGuanzhu();
		$guanzhu->guanzhu($concerned_id);


	}
}